home *** CD-ROM | disk | FTP | other *** search
/ The World of Computer Software / The World of Computer Software.iso / miscpas.zip / RANDDOT.PAS < prev    next >
Pascal/Delphi Source File  |  1984-05-16  |  2KB  |  76 lines

  1. program RandDot;
  2.  
  3. {  This program displays on the graphics screen random dots at a very high
  4. {  high speed.  20,000 dots are displayed in a few seconds.
  5. {
  6. {  The program was written for Turbo Pascal by Jeff Firestone.
  7. {
  8. {  NOTE -- This program uses the external assembly language procedure
  9. {  POINT.INV which must be on the default drive inorder to compile.}
  10.  
  11.       type
  12.         varX = record
  13.           varL,varH: Byte;
  14.         end;
  15.         TimeRec = record
  16.           AX,BX: varX;
  17.           Min,Hour,Msec,Sec: byte;
  18.           BP,SI,DI,DS,ES,FLAGS: integer;
  19.         end;
  20.         RecPack = record
  21.           AX: varX;
  22.           BX,CX,DX,BP,SI,DI,DS,ES,FLAGS: Integer;
  23.         end;
  24.  
  25.       var
  26.         intparm : RecPack;
  27.         i,j : integer;
  28.         rx,ry : integer;
  29.  
  30.       procedure GraphicsOn;
  31.       begin
  32.         with IntParm do
  33.           begin
  34.             AX.varH := $00;
  35.             AX.varL := $06;
  36.             Intr($10,intparm);
  37.           end;
  38.       end;
  39.  
  40.       procedure GraphicsOff;
  41.       begin
  42.         with IntParm do
  43.           begin
  44.             AX.varH := $00;
  45.             AX.varL := $02;
  46.             Intr($10,intparm);
  47.           end;
  48.       end;
  49.  
  50.       procedure Dot(x,y: integer);
  51.       begin
  52.         with IntParm do
  53.           begin
  54.             AX.varH := 12;
  55.             AX.varL := $81;
  56.             CX := x;
  57.             DX := y;
  58.             Intr($10,intparm);
  59.           end;
  60.       end;
  61.  
  62. Procedure Point(x,y,color:integer); External 'point.inv';
  63.  
  64. begin
  65.   GraphicsOn;
  66.   for i:= 1 to 20000 do
  67.     begin
  68.       rx:= random(639);
  69.       ry:= random(199);
  70.       point(rx,ry,1);
  71.     end;
  72.   write('            '+chr(13));
  73.   writeln(' Hit RETURN');
  74.   readln;
  75.   GraphicsOff;
  76. end.